/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package controller;

import AdminOperations.AdminAddAdv;
import AdminOperations.AdminManageGuest;
import AdminOperations.AdminManageTheme;
import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

/**
 * Web application lifecycle listener.
 * @author ABDELMOHSEN
 */
public class ApplicationStartup implements ServletContextListener {

    public void contextInitialized(ServletContextEvent sce) {
        ServletContext cntxt= sce.getServletContext();
        AdminManageGuest regModel=new AdminManageGuest();
        AdminManageTheme thModel= new AdminManageTheme();
        cntxt.setAttribute("register",String.valueOf(regModel.isregistrationallowed()));
        cntxt.setAttribute("theme",new Integer(thModel.getSelectedThemeFromFile()));
        cntxt.setAttribute("url",new AdminAddAdv().getAdv());
    }

    public void contextDestroyed(ServletContextEvent sce) {
        
    }
}
